<template>
	<view class="details">
		<view class="title">{{detailsData.title}}</view>
		<view class="date">{{detailsData.create_time}}</view>
		<view class="content">
			<u-parse :html="detailsData.content"></u-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				detailsData: ''
			}
		},
		onLoad(option) {
			this.id = option.id
			uni.showLoading({
				title: '加载中'
			})
			this.detailsInfo()
		},

		methods: {
			detailsInfo() {
				this.$api.post(global.apiUrls.getNewsDetails, {
					id: this.id
				}).then(res => {
					uni.hideLoading()
					if (res.data.code == 1) {
						this.detailsData = res.data.data
					} else {
						this.$message.info(res.data.msg)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>

	page {
		background: #F8F8F8;
		color: #333333;
		font-size: 32rpx;
	}

	.details {
		padding: 32rpx;
		.title {
			font-size: 32rpx;
			font-family: PingFang SC;
			font-weight: 500;
			line-height: 48rpx;
			color: #333333;
			margin-bottom: 20rpx;
		}
		.date {
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 400;
			line-height: 48rpx;
			margin-bottom: 24rpx;
		}
		.content {
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 400;
			line-height: 42rpx;
			color: #666666;
		}
	}
</style>
